#include<iostream>
#include<cstring>
using namespace std;
typedef long long LL;
const int N = 15, M = 1 << N;
LL f[N][M];
bool st[N];
int n, m;
int main()
{
	while (cin >> n >> m, n || m) {
		for (int i = 0; i < 1 << n; i++) {
			st[i] = 1;
			int cnt = 0;
			for (int j = 0; j < n; j++) {
				if (i >> j & 1) {
					if (cnt & 1) {
						st[i] = 0;
						break;
					}
				}
				else cnt++;
			}
			if (cnt & 1)st[i] = 0;
		}
		memset(f, 0, sizeof(f));
		f[0][0] = 1;
		for (int i = 1; i <= m; i++) {
			for (int j = 0; j < 1 << n; j++) {
				for (int k = 0; k < 1 << n; k++) {
					if ((j & k) == 0 && st[j | k]) {
						f[i][j] += f[i - 1][k];
					}
				}
			}
		}
		cout << f[m][0] << endl;
	}
	return 0;
}